#include "StdAfx.h"
#include "xUtil.h"

void ComSafeRelease(IUnknown *&pObj)
{
	if(pObj != NULL)
	{
#ifdef _DEBUG
		int		ref = pObj->Release();
		
		if(ref != 0)
		{
			CString		str;

			str.Format(L"Com Object Refcount = %d (0x%08X)\n", ref, (DWORD)pObj);
			OutputDebugString(str);
		}
#else
		pObj->Release();
#endif
		pObj = NULL;
	}
}

xRectF &xRectF::operator = (const RECT &rect)
{
	left = (FLOAT)rect.left;
	top = (FLOAT)rect.top;
	right = (FLOAT)rect.right;
	bottom = (FLOAT)rect.bottom;
	return *this;
}

void xRectF::OffsetRect(FLOAT x, FLOAT y)
{
	left += x;
	top += y;
	right += x;
	bottom += y;
}